import request from '@/api/request'

// TS 类型声明
export interface PhoneLoginReq { phone: string; code: string; role: string }
export interface PhoneLoginResp { token: string; user?: { name?: string; role?: string; phone?: string; [k: string]: any } }

/**
 * @description 手机号登录
 */
export function phoneLogin(data: PhoneLoginReq) {
  return request<PhoneLoginResp>({
    url: '/auth/phone',
    method: 'POST',
    data
  })
}
